package huaweiod.second;

import java.util.Scanner;

public class C10_MapTreasureHunt {

    public static int[][] dir = {{0, 1}, {1, 0}};

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int k = in.nextInt();
        boolean[][] visit = new boolean[n][m];
        System.out.println(dfs(0, 0, visit, k));
    }

    private static int dfs(int i, int j, boolean[][] visit, int k) {
        if (i == -1 || i == visit.length || j == -1 || j == visit[0].length || visit[i][j]) {
            return 0;
        } else {
            // 数位之和
            int bitSum = 0;
            int x = i;
            int y = j;
            while (x > 0) {
                bitSum += x % 10;
                x /= 10;
            }
            while (y > 0) {
                bitSum += y % 10;
                y /= 10;
            }
            if (bitSum > k) {
                return 0;
            }

            int count = 1;
            visit[i][j] = true;
            for (int d = 0; d < dir.length; d++) {
                count += dfs(i + dir[d][0], j + dir[d][1], visit, k);
            }
            return count;
        }

    }
}
